package com.green.configfile.config;

import com.green.configfile.factory.YamlPropertySourceFactory;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;

@Data
@Configuration
@ConfigurationProperties(prefix = "db2")
//指定它读取那个文件
@PropertySource(value = {"application-db2.yml"},factory = YamlPropertySourceFactory.class)
public class DataBaseConfig2 {

    private String classname;
    private String url;
    private String username;
    private String password;
}
